<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a href="javascript:testToJava()">测试与java代码交互</a>
</body>
<script>
    function testToJava() {
        window.test({
            request: '发送给JAVA的数据',
            persistent: false,
            onSuccess: function (response) {
                alert("返回的数据:" + response);
            },
            onFailure: function (error_code, error_message) {
            }
        });
    }
</script>
</html>